package ssh

import (
	"tushare/service/shell"
)

func (ssh Ssh) InstallApp(appType, ip string) {
	if appType == "nginx" {
		ipObj := new(shell.InstallApp)
		ssh.LoginEcs(ip, ipObj.InstallNginx())
	} else if appType == "nginxSbin" {
		ipObj := new(shell.InstallApp)
		ssh.LoginEcs(ip, ipObj.InstallNginxSbin())
	} else if appType == "redis" {
		ipObj := new(shell.InstallApp)
		ssh.LoginEcs(ip, ipObj.InstallRedis())
	} else if appType == "maven" {
		ipObj := new(shell.InstallApp)
		ssh.LoginEcs(ip, ipObj.InstallMaven())
	} else if appType == "java" {
		ipObj := new(shell.InstallApp)
		ssh.LoginEcs(ip, ipObj.InstallJava())
	} else if appType == "hadoop" {
		ipObj := new(shell.InstallApp)
		ssh.LoginEcs(ip, ipObj.InstallHadoop())
	} else if appType == "scala" {
		ipObj := new(shell.InstallApp)
		ssh.LoginEcs(ip, ipObj.InstallScala())
	} else if appType == "kafka" {
		ipObj := new(shell.InstallApp)
		ssh.LoginEcs(ip, ipObj.InstallKafka())
	} else if appType == "spark" {
		ipObj := new(shell.InstallApp)
		ssh.LoginEcs(ip, ipObj.InstallSpark())
	}
}
